package com.fadis.data.base;

import java.util.Objects;

public class FadisString implements Comparable<FadisString>, IBaseData{

    private String str;

    public String getStr() {
        return str;
    }

    public void setStr(String str) {
        this.str = str;
    }

    public FadisString(String str) {
        this.str = str;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FadisString that = (FadisString) o;
        return Objects.equals(str, that.str);
    }

    @Override
    public int hashCode() {
        return Objects.hash(str);
    }

    
    @Override
    public int compareTo(FadisString o) {
        if (this == o) return 0;
        if (o == null) return 1;
        return this.str.compareTo(o.str);
    }

    //    public static void main(String[] args) {
//        String s = "ddd的的";
//        System.out.println(s.length());  // 5
//        System.out.println(SafeEncoder.encode(s).length); // 9 = 3 + 6
//    }
}
